#ifndef __MULT_H__
#define __MULT_H__

/* clang-format off */
// MULT可用IO
#define MULT_IO_0 PIN_TRST
#define MULT_IO_1 PIN_TDI
#define MULT_IO_2 PIN_TMS
#define MULT_IO_3 PIN_TCK
#define MULT_IO_4 PIN_RTCK
#define MULT_IO_5 PIN_TDO
#define MULT_IO_6 PIN_RESET

#define MULT_DIR_0 PIN_TRST_DIR
#define MULT_DIR_1 PIN_TDI_DIR
#define MULT_DIR_2 PIN_TMS_DIR
#define MULT_DIR_3 PIN_TCK_DIR
#define MULT_DIR_4 PIN_RTCK_DIR
#define MULT_DIR_5 PIN_TDO_DIR
#define MULT_DIR_6 PIN_RESET_DIR

#define ID_MULT_Info    ID_DAP_Vendor0 // 接口支持信息
#define ID_MULT_Setup   ID_DAP_Vendor1 // 打开接口
#define ID_MULT_Queue   ID_DAP_Vendor2 // 多条命令
#define ID_MULT_Cmd     ID_DAP_Vendor3 // 命令
#define ID_MULT_Read    ID_DAP_Vendor4 // 读
#define ID_MULT_Write   ID_DAP_Vendor5 // 写
/* clang-format on */

// 默认的接口状态
#define MULT_MODE_DEFAULT 0U

// 接口数量
#define MULT_MODE_NUMBER 1U

// 接口使能情况
#define MULT_ENABLE_I2C 1U
#define MULT_ENABLE_SPI 0U

typedef struct _mult_interface_t
{
    void (*mult_init)(void);
    uint32_t (*mult_cmd)(const uint8_t *request,
                         uint8_t *response);
    uint32_t (*mult_read)(const uint8_t *request,
                          uint8_t *response);
    uint32_t (*mult_write)(const uint8_t *request,
                           uint8_t *response);
} mult_interface_t;

#ifdef __cplusplus
extern "C"
{
#endif

    uint32_t DAP_ProcessVendorCommand(const uint8_t *request,
                                      uint8_t *response);

#ifdef __cplusplus
}
#endif

#endif /* __MULT_H__ */
